<%@page language="java" pageEncoding="UTF-8"%>    
<%@page contentType="text/html; charset=UTF-8"%>
<%@page import="java.net.*" %> 
<%@page import="java.net.*" %> 
<%@page import="net.ssta.common.LoginUser" %>

<%        
      String path = request.getContextPath();
	  response.setHeader("ContentType","text/xml");  
      response.setHeader("Pragma","No-Cache");   
      response.setDateHeader("Expires",0);   
      response.setHeader("Cache-Control","No-Cache");  
%>

<%  
	request.setCharacterEncoding("UTF-8");
	
	String userid = LoginUser.getUserId();
	
	String kjcgid = request.getParameter("kjcgid");
        if(kjcgid == null ) kjcgid="";
    String title = request.getParameter("title");
    //title = new String(title.getBytes("UTF-8"),"GBK");
    
    String enjoytype=""; 
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<head> 

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>项目信息－国家安科网</title>

<link href="<%=path%>/common1/css/layout.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/common1/css/user.css" rel="stylesheet" type="text/css" />

   
<script language = "javascript" src = "../common/js/list.js" type = "text/javascript"></script>
<script language = "javascript" src = "../common/js/pool.js" type = "text/javascript"></script>
<script language = "javascript" src = "../common/js/page.js" type = "text/javascript"></script>
<script language = "javascript" src = "../common/js/log.js" type = "text/javascript"></script>
<script language = "javascript" src = "../common/js/message.js" type = "text/javascript"></script>
<script language = "javascript" src = "js/search.js" type = "text/javascript"></script>
<script language = "javascript" src = "js/setcondition.js" type = "text/javascript"></script>
<script language = "javascript" src = "../common/js/mycollection.js" type = "text/javascript"></script>
<script language = "javascript" src = "../common/js/g_variables.js" type = "text/javascript"></script>

<script type='text/javascript' src="<%=path%>/includes/js/jquery.js"></script>


<xml id="resultDom"></xml>


<style>
	
	.cnkiBar{
		font-size:15px;
		color:#990000;
		font-weight:bold;
	}
</style>



</head>
<script>

    var enjoytype = "<%=enjoytype%>"  
    
    function doZoom(size)
	{
		document.getElementById('zoom').style.fontSize=size+'px';
	}
	
	var title = "";
	
	
	//查看完整信息
	function viewCompInfo(kjcgid){
		window.open("<%=path%>/achieve1/report.jsp?kjcgid="+$.trim(kjcgid));
	}
	
	
		
	//查看科技成果
	function viewKjcg(kjcgid,kjcgname){
		window.open("<%=path%>/achieve1/info.jsp?kjcgid="+$.trim(kjcgid)+"&title="+$.trim(kjcgname));
	}

	//推荐科技成果
	function load_tjkjcg(divid,http){
		$.ajax({
			type:"POST",
			url:http,
			error:function(msg)
			{
				//alert("操作失败，请重试！"+msg);
			},
		    success:function(data)
		    {
		    	var data = eval("("+data+")");
		    	//alert(data);
				var html="";
				var showcount = 10;
				var i=0;
				for(i=0;i<data.length&&i<showcount;i++){
					var kjcgname = data[i]['kjcgname'];
					html+="<li>";
					html+="<a href='#2012' style=\"width:100%\" onclick=\"viewKjcg('"+data[i]['kjcgid']+"')\">"+kjcgname.substring(0,20)+"</a></li>";
					//html+="<span>";
					//html+=data[i]['unitname'].substring(0,8);
					//html+="</span>";
				}
				for(var j=i;j<showcount;j++){
					html+="<li><a style=\"width:100%\" href=\"#\"></a></li>";
				}
				$("#"+divid).html(html);
			}
		});
	}
		
	
	
	function loadCnkiInfo(){
		var cnkihttp = new ActiveXObject("Microsoft.XMLHTTP");
			var name = title;
			//name="绿色饲料添加剂"
            //name = encodeURI(name);//如果web服务器配的URIEncoding为utf-8,则加这句,getCNKIJSON.jsp也要解码
            var url ="<%=path%>/achieve/agent/getCNKIJSON.jsp?title="+name;
            alert(url);
            
            cnkihttp.open("GET", url, false);
            cnkihttp.send(); 
            var cnkixml = new ActiveXObject("Microsoft.XMLDOM");
            cnkixml.loadXML(cnkihttp.responseText);
           
            var cnkiinfoNodeList = cnkixml.documentElement.selectNodes("//param");
            
            var cnkiinfo1 = "";
            var cnkiinfo2 = "";
            var cnkiinfo3 = "";
            var cnkiinfo4 = "";
            var cnkiinfo5 = "";
            var cnkiinfo6 = "";
            var cnkiinfo7 = "";
            if(cnkiinfoNodeList.length > 0) {
            	//完成单位发表文献 
                cnkiinfo1 = "DBName="+cnkiinfoNodeList.item(0).childNodes.item(0).text;
                cnkiinfo1 += "&RunID="+cnkiinfoNodeList.item(0).childNodes.item(1).text;
                cnkiinfo1 += "&RunName="+cnkiinfoNodeList.item(0).childNodes.item(2).text;
                cnkiinfo1 += "&RunParam="+cnkiinfoNodeList.item(0).childNodes.item(3).text;
                //成果完成人发表文献   
                cnkiinfo2 = "DBName="+cnkiinfoNodeList.item(1).childNodes.item(0).text;
                cnkiinfo2 += "&RunID="+cnkiinfoNodeList.item(1).childNodes.item(1).text;
                cnkiinfo2 += "&RunName="+cnkiinfoNodeList.item(1).childNodes.item(2).text;
                cnkiinfo2 += "&RunParam="+cnkiinfoNodeList.item(1).childNodes.item(3).text;
                //所涉核心技术研究动态  
                cnkiinfo3 = "DBName="+cnkiinfoNodeList.item(2).childNodes.item(0).text;
                cnkiinfo3 += "&RunID="+cnkiinfoNodeList.item(2).childNodes.item(1).text;
                cnkiinfo3 += "&RunName="+cnkiinfoNodeList.item(2).childNodes.item(2).text;
                cnkiinfo3 += "&RunParam="+cnkiinfoNodeList.item(2).childNodes.item(3).text;
                //成果产出状态分析 DBName=SNAD;RunID=SNAD_CCZTFX;RunName
                cnkiinfo4 = "DBName="+cnkiinfoNodeList.item(3).childNodes.item(0).text;
                cnkiinfo4 += "&RunID="+cnkiinfoNodeList.item(3).childNodes.item(1).text;
                cnkiinfo4 += "&RunName="+cnkiinfoNodeList.item(3).childNodes.item(2).text;
                cnkiinfo4 += "&RunParam="+cnkiinfoNodeList.item(3).childNodes.item(3).text;
                
                //本领域专利与标准
          		cnkiinfo5 = "DBName="+cnkiinfoNodeList.item(4).childNodes.item(0).text;
                cnkiinfo5 += "&RunID="+cnkiinfoNodeList.item(4).childNodes.item(1).text;
                cnkiinfo5 += "&RunName="+cnkiinfoNodeList.item(4).childNodes.item(2).text;
                cnkiinfo5 += "&RunParam="+cnkiinfoNodeList.item(4).childNodes.item(3).text;
                
                // 本成果研究背景 
                cnkiinfo6 = "DBName="+cnkiinfoNodeList.item(5).childNodes.item(0).text;
                cnkiinfo6 += "&RunID="+cnkiinfoNodeList.item(5).childNodes.item(1).text;
                cnkiinfo6 += "&RunName="+cnkiinfoNodeList.item(5).childNodes.item(2).text;
                cnkiinfo6 += "&RunParam="+cnkiinfoNodeList.item(5).childNodes.item(3).text;
                //本成果应用动态
                cnkiinfo7 = "DBName="+cnkiinfoNodeList.item(6).childNodes.item(0).text;
                cnkiinfo7 += "&RunID="+cnkiinfoNodeList.item(6).childNodes.item(1).text;
                cnkiinfo7 += "&RunName="+cnkiinfoNodeList.item(6).childNodes.item(2).text;
                cnkiinfo7 += "&RunParam="+cnkiinfoNodeList.item(6).childNodes.item(3).text;
            }
            var cnkihttp1 = new ActiveXObject("Microsoft.XMLHTTP");
            cnkiinfo4 = encodeURI(cnkiinfo4);
            //alert("encode后:"+cnkiinfo4);
		    cnkihttp1.open("POST", "<%=path%>/achieve/agent/getCNKIInfo.jsp?"+cnkiinfo4, false);
		    cnkihttp1.send();
		    if(trim(cnkihttp1.responseText)!=""){
		    	$("#cnkiDiv1").html('<div class="cnkiBar">研发单位</div>'+cnkihttp1.responseText);
		    }
		    
		    
		    cnkiinfo1 = encodeURI(cnkiinfo1);
		    var cnkihttp2 = new ActiveXObject("Microsoft.XMLHTTP");
		    cnkihttp2.open("POST", "<%=path%>/achieve/agent/getCNKIInfo.jsp?"+cnkiinfo1, false);
		    cnkihttp2.send();
		    if(trim(cnkihttp2.responseText)!=""){
		    	$("#cnkiDiv2").html(cnkihttp2.responseText);
		    }
		    
		    //相关成果、标准、专利
		    cnkiinfo5 = encodeURI(cnkiinfo5);
		    var cnkihttp5 = new ActiveXObject("Microsoft.XMLHTTP");
            cnkihttp5.open("POST", "<%=path%>/achieve/agent/getCNKIInfo.jsp?"+cnkiinfo5, false);
            cnkihttp5.send();
            if(trim(cnkihttp5.responseText)!=""){
            	$("#cnkiDiv3").html('<div class="cnkiBar">相关成果、标准、专利</div>'+cnkihttp5.responseText);
            }
            
		    //相关文献
		    cnkiinfo3 = encodeURI(cnkiinfo3);
		    cnkiinfo6 = encodeURI(cnkiinfo6);
		    cnkiinfo7 = encodeURI(cnkiinfo7);
		    
		    
		    /*var cnkihttp4 = new ActiveXObject("Microsoft.XMLHTTP");
            cnkihttp4.open("POST", "<%=path%>/achieve/agent/getCNKIInfo.jsp?"+cnkiinfo6, false);
            cnkihttp4.send();
            
            var cnkihttp7 = new ActiveXObject("Microsoft.XMLHTTP");
            cnkihttp7.open("POST", "<%=path%>/achieve/agent/getCNKIInfo.jsp?"+cnkiinfo7, false);
            cnkihttp7.send();*/
		    
		    var cnkihttp6 = new ActiveXObject("Microsoft.XMLHTTP");
            cnkihttp6.open("POST", "<%=path%>/achieve/agent/getCNKIInfo.jsp?"+cnkiinfo3, false);
            cnkihttp6.send();
            
            if(trim(cnkihttp6.responseText)!=""){
		    	$("#cnkiDiv4").html('<div class="cnkiBar">相关文献</div>'+cnkihttp6.responseText);
		    }
	}
    
    
    $("document").ready(function()
	{
		 //按键登录
	     $("#item_3").keydown(function(e){ 
			 var curkey = e.which; 
			 if(curkey == 13){
				doSearch();
	         }
	     });
	    
		 columnid ="001";
         columninfoid = "<%=kjcgid%>";
         columninfoname = "<%=title%>";
		 var kjcgid = "<%=kjcgid%>";
         sendLog("001","项目信息",kjcgid,title);
         var url = "<%=path%>/achieve/agent/getKjcgInfo.jsp?kjcgid=<%=kjcgid%>&jtime=" + (new Date()).getTime();       
         XmlHttpPool.GetRemoteData(url,showKjcgInfo);
         
         
         //加载推荐科技成果
		 var http = "<%=path%>/front/AchieveServlet?method=getRecommendKjcgList&showType=ChannelShow";
		 load_tjkjcg("zylist",http);
         
         
         //alert("11:"+title);
		 //连接同方知网
		 //loadCnkiInfo();
		 
         
	});
	
	
	function _addCollection(){
		document.getElementById("collectionurl").value=window.location.href;
		 $.ajax({
				type: "POST", url: "<%=path%>/membercenter/collection?method=addCollection",
				data:$("#collectionform").serialize(),
				error:function(){alert("与服务器失去联系，请刷新本页面后再重试！");},
				success: function(msg){
					alert("收藏操作成功!");
				}
			 });
	}
</script>

<html>
<body>

<%@include file="../common1/toplogin.jsp"%>
<%@include file="../common1/topbanner.jsp"%>
<%@include file="../common1/topmenu.jsp"%>








<!--页面主体部分-->
<div id="contentmain">
	
	<div id="all_content_right">
	    <div id="topsearchbox_695">
		    <form id="searchform" name="searchform" action="<%=path%>/achieve1/search_results.jsp" method="post" >
				<ul>
					<li><img src="<%=path%>/common/images/search/icon.gif" /></li>
					<li><span class="bluetitle">关键字</span></li>
					<li>
						<input type="text" style="width:0px;border:0px;" />
						<input type="text" name="item_3" id="item_3" size="18" style="margin-top:2px;" />
	                    <input type="hidden" name="topicname" id="topicname" value=""/>
	                 　　	<input type="hidden" name="key" id="key" value=""/>   
					</li>
					<li>
						<a href="javascript:doSearch();">
							<img  src="<%=path%>/common/images/search/botton1.gif" style="border:0px;margin-top:4px;"/>
						</a>
					</li>
					<li>
						<span><a href="<%=path%>/achieve1/advancedsearch.jsp" target="_self">高级搜索</a></span>
					</li>
					<li>
						<a href="<%=path%>/achieve1/needforachieve.jsp" target="_self">帮您找项目</a>
					</li>
				</ul>
			</form>
		</div>
		<div id="border_box">
		    <div id="ind_title"><font>当前位置：<a href="/cms" class="blue">首页</a> > <a href="<%=path%>/achieve1/achieveIndex.jsp" class="blue">科技成果</a> > 正文</font><span></span></div>
			<div id="int_show_con_title" style="height:auto;padding-left:10px;"></div>
			<div style="float:right;margin-right:100px;"><a href="javascript:viewCompInfo('<%=kjcgid%>');">查看完整信息</a></div>
			<!--  -->
			<div id="int_show_con_info">
			    <span></span>
				<span></span>
				<span></span>
				<span></span>
			</div>
			
			<div id="int_show_con_content">
			<span id="zoom">
				   <div id="progressbar" class="bar_progress">数据加载中,请稍候......</div>
				   <div id="showkjcginfo">
						<div id="showunitinfo"></div>	
		              	<div id="collect"></div> 												
			       </div>
			       <div style="text-align:center;margin-top:30px;padding-bottom:20px;">
			       		<%if(userid!=null && userid!=""){//只有用户登录后才能显示收藏按钮%>
							<span onClick="javascript:_addCollection();"><img src="<%=path%>/common1/images/intshow/botton4.gif" border="0" style="cursor:pointer;" /></span>&nbsp;
		                <%}%>
			       </div>
			</span>
			</div>
		</div>
	</div>
	
	
	<div id="all_content_left">
    	<%@include file="../common/adleft.jsp"%>
		<div id="border_box_orange">
		    <div id="ind_title_cont_righttitle"><a href="<%=path%>/achieve1/search_results.jsp?key=ChannelShow='1'&topicname=推荐成果" class="blue"><font>推荐成果</font></a><span><a href="<%=path%>/achieve1/search_results.jsp?key=ChannelShow='1'&topicname=推荐成果" class="blue">更多...</a></span></div>
			<ul id="zylist">
				<li><a href="#"></a></li>
				<li><a href="#"></a></li>
				<li><a href="#"></a></li>
				<li><a href="#"></a></li>
				<li><a href="#"></a></li>
				<li><a href="#"></a></li>
				<li><a href="#"></a></li>
				<li><a href="#"></a></li>
				<li><a href="#"></a></li>
				<li><a href="#"></a></li>
			</ul>
		</div>
	</div>
	
	
</div>


   
<!-- 同方知网 -->
<div style="width:800px;text-align:left;">
	<!--相关成果-->
	<div id="cnkiDiv1"></div>
	
	<!---->
	<div id="cnkiDiv2"></div>
	
	<!--相关成果、标准、专利-->
	<div id="cnkiDiv3"></div>
	
	<!--相关文献-->
	<div id="cnkiDiv4"></div>
</div>
 
<%@include file="../common/bottom.jsp"%>

<form name="collectionform" id="collectionform">
<cms:infobase>
	<input type="hidden" name="channelid" id="channelid" value="11" />
    <input type="hidden" name="channelname" id="channelname" value="科技成果" />
    <input type="hidden" name="infotitle" id="infotitle" value="" />
    <input type="hidden" name="infoid" id="infoid" value="<%=kjcgid%>" />
    <input type="hidden" name="collectionurl" id="collectionurl" value="" />
</cms:infobase>    
</form>


</body>
</html>

